<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="SearchContacts.aspx.vb" Inherits="GTSWeb_Carrier_NewONE" title="GTS Frieght Management System"  MaintainScrollPositionOnPostback="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server">
    <h3>Search Contact Information</h3>
    <p>
        <strong><span style="color: #ff0066"></span></strong></p>
    <strong>
    Contact Name </strong>&nbsp;<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource1"
        DataTextField="ContactName" DataValueField="ContactInfoID" Width="176px">
    </asp:DropDownList><br />
    &nbsp;<br />
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CellPadding="4"
        DataKeyNames="ContactInfoID" DataSourceID="ObjectDataSource2" ForeColor="#333333"
        GridLines="None" Height="50px" Width="288px">
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
        <EditRowStyle BackColor="#999999" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <Fields>
            <asp:BoundField DataField="ContactInfoID" HeaderText="ContactInfoID" ReadOnly="True"
                SortExpression="ContactInfoID" Visible="False" />
            <asp:TemplateField HeaderText="Location">
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource1"
                        DataTextField="City" DataValueField="LocationID" SelectedValue='<%# Bind("LocationID") %>'>
                    </asp:DropDownList><asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
                        SelectMethod="getLocations" TypeName="GTSSystem.BLL.Location"></asp:ObjectDataSource>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# GTSSystem.BLL.Location.GetLocationNameByLocationID(Cint(Eval("LocationId"))) %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="LocationID" HeaderText="LocationID" SortExpression="LocationID" ReadOnly="True" Visible="False" />
            <asp:BoundField DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName" />
            <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
            <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="StreetAddress" HeaderText="StreetAddress" SortExpression="StreetAddress" />
            <asp:CommandField ShowEditButton="True" ShowInsertButton="True" />
        </Fields>
        <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderTemplate>
            Contact Information
        </HeaderTemplate>
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:DetailsView>
    &nbsp;&nbsp;&nbsp;
    <br />
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" InsertMethod="addContactInfo"
        OldValuesParameterFormatString="{0}" SelectMethod="getContactInfoByID"
        TypeName="GTSSystem.BLL.ContactInfo" UpdateMethod="updateContactInfo">
        <UpdateParameters>
            <asp:Parameter Name="ContactInfoID" Type="Int32" />
            <asp:Parameter Name="LocationID" Type="Int32" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="StreetAddress" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="ContactInfoID" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="LocationID" Type="Int32" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="StreetAddress" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" InsertMethod="addContactInfo"
        OldValuesParameterFormatString="{0}" SelectMethod="getContactInfo" TypeName="GTSSystem.BLL.ContactInfo"
        UpdateMethod="updateContactInfo">
        <UpdateParameters>
            <asp:Parameter Name="ContactInfoID" Type="Int32" />
            <asp:Parameter Name="LocationID" Type="Int32" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="StreetAddress" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="ContactInfoID" Type="Int32" />
            <asp:Parameter Name="LocationID" Type="Int32" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="StreetAddress" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Content>

